<template>
<section>
  <div v-for="(item,index) of list" :key="index">
    <div class="item-title">
      <span class="iconfont">&#xe604;</span>
      {{item.title}}
      <span v-if="item.price" class="price">{{item.price}}</span>
    </div>
    <div v-if="item.children" class="item-children">
      <detail-list :list="item.children"></detail-list>
    </div>
  </div>
</section>
</template>
<script>
export default {
  name: 'DetailList',
  props: {
    list: Array
  }
}
</script>
<style lang="stylus" scoped>
.item-title
  position: realtive
  font-size: 1.6rem
  line-height: 2.0rem
  border-bottom-style: solid
  border-bottom-color: #dadada
  border-bottom-width: .1rem
.item-title span:first-child
  margin-left: .5rem
  margin-right: .7rem
  color: #00bcd4
  font-size: 2.0rem
.item-children
  padding 0 .7rem
.price
  color: #ff9800
  position: absolute
  right: 2.7rem
</style>
